from osgeo import gdal, ogr
gdal.UseExceptions()
dataset:gdal.Dataset = gdal.Open("D:/Code/Python/pyGDAL/Include/dataset/raster.tif")
band:gdal.Band = dataset.GetRasterBand(1)
ogr_Driver:ogr.Driver = ogr.GetDriverByName("ESRI Shapefile")
shp:ogr.DataSource = ogr_Driver.CreateDataSource("D:/Code/Python/pyGDAL/Include/dataset/Polygonize.shp")
shp_layer = shp.CreateLayer("shp", None)
gdal.Polygonize( band, None, shp_layer, -1, [], callback=None )
shp.Destroy()